package com.onlineMIS.sorter;

import java.util.Comparator;
import com.onlineMIS.action.headQ.report.HqReportItemVO;
import com.onlineMIS.action.headQ.report.HqSalesStatisticReportItemVO;
import com.onlineMIS.action.headQ.report.HqTabletReportItemVO;

public class HqStatisticReportItemVOByQuantitySorter implements
		Comparator<HqTabletReportItemVO> {

	@Override
	public int compare(HqTabletReportItemVO o1,
			HqTabletReportItemVO o2) {
		boolean isChainO1 = o1.getIsChain();
		boolean isChainO2 = o2.getIsChain();
		
		
		int quantityO1 = o1.getNoQuantityPei();
		int quantityO2 = o2.getNoQuantityPei();

		
		if (isChainO1 != isChainO2){
			if (isChainO1)
				return 1;
			else 
				return -1;
		} else 
			return quantityO2 - quantityO1;
		}
	}

